home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Balloons.a < prev    next >
Text File  |  1996-05-01  |  13KB  |  426 lines

  1. ;
  2. ;    File:        Balloons.a
  3. ;
  4. ;    Contains:    Balloon Help Package Interfaces.
  5. ;
  6. ;    Version:    Technology:    Copland
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__BALLOONS__') = 'UNDEFINED' THEN
  19. __BALLOONS__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  25.     include 'Quickdraw.a'
  26.     ENDIF
  27.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  28.     include 'Menus.a'
  29.     ENDIF
  30.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  31.     include 'AppleEvents.a'
  32.     ENDIF
  33.     IF &TYPE('__TEXTSERVICES__') = 'UNDEFINED' THEN
  34.     include 'TextServices.a'
  35.     ENDIF
  36.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  37.     include 'TextEdit.a'
  38.     ENDIF
  39.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  40.     include 'Errors.a'
  41.     ENDIF
  42.     IF &TYPE('__COACHMARKS__') = 'UNDEFINED' THEN
  43.     include 'CoachMarks.a'
  44.     ENDIF
  45.     IF &TYPE('__HIOBJECTTYPES__') = 'UNDEFINED' THEN
  46.     include 'HIObjectTypes.a'
  47.     ENDIF
  48. ;  Cool for both System 7 and 8
  49.     IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
  50.  
  51. kTopLeftTipPointsLeftVariant    EQU        0
  52. kTopLeftTipPointsUpVariant        EQU        1
  53. kTopRightTipPointsUpVariant        EQU        2
  54. kTopRightTipPointsRightVariant    EQU        3
  55. kBottomRightTipPointsRightVariant EQU    4
  56. kBottomRightTipPointsDownVariant EQU    5
  57. kBottomLeftTipPointsDownVariant    EQU        6
  58. kBottomLeftTipPointsLeftVariant    EQU        7
  59. kBalloonVariantCount            EQU        8
  60. ; typedef SInt16                         BalloonVariant
  61.  
  62. ;  * remove the currently onscreen balloon, if any
  63. ;
  64. ; pascal OSErr HMRemoveBalloon(void )
  65. ;
  66.     IF ¨ GENERATINGCFM THEN
  67.         Macro
  68.         _HMRemoveBalloon
  69.             move.w              #$0002,D0
  70.             dc.w                $A830
  71.         EndM
  72.     ELSE
  73.         IMPORT_CFM_FUNCTION HMRemoveBalloon
  74.     ENDIF
  75.  
  76.     ENDIF
  77. ;  * Old API--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  78.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  79.  
  80. hmBalloonHelpVersion            EQU        $0002                ; The real version of the Help Manager 
  81. kHMHelpMenuID                    EQU        -16490                ; Resource ID and menu ID of help menu 
  82. kHMAboutHelpItem                EQU        1                    ; help menu item number of About Balloon Help... 
  83. kHMShowBalloonsItem                EQU        3                    ; help menu item number of Show/Hide Balloons 
  84. kHMHelpID                        EQU        -5696                ; ID of various Help Mgr package resources (in Pack14 range) 
  85. kBalloonWDEFID                    EQU        126                    ; Resource ID of the WDEF proc used in standard balloons 
  86.                                                             ; Dialog item template type constant 
  87. helpItem                        EQU        1                    ; key value in DITL template that corresponds to the help item 
  88.                                                             ; Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources 
  89. hmDefaultOptions                EQU        0                    ; default options for help manager resources 
  90. hmUseSubID                        EQU        1                    ; treat resID's in resources as subID's of driver base ID (for Desk Accessories) 
  91. hmAbsoluteCoords                EQU        2                    ; ignore window port origin and treat rectangles as absolute coords (local to window) 
  92.  
  93. hmSaveBitsNoWindow                EQU        4                    ; don't create a window, just blast bits on screen. No update event is generated 
  94. hmSaveBitsWindow                EQU        8                    ; create a window, but restore bits behind window when window goes away & generate update event 
  95. hmMatchInTitle                    EQU        16                    ; for hwin resources, match string anywhere in window title string 
  96.                                                             ; Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources 
  97. kHMStringItem                    EQU        1                    ; pstring used in resource 
  98. kHMPictItem                        EQU        2                    ; 'PICT' ResID used in resource 
  99. kHMStringResItem                EQU        3                    ; 'STR#' ResID & index used in resource 
  100. kHMTEResItem                    EQU        6                    ; Styled Text Edit ResID used in resource ('TEXT' & 'styl') 
  101. kHMSTRResItem                    EQU        7                    ; 'STR ' ResID used in resource 
  102. kHMSkipItem                        EQU        256                    ; don't display a balloon 
  103. kHMCompareItem                    EQU        512                    ; Compare pstring in menu item w/ PString in resource item ('hmnu' only) 
  104. kHMNamedResourceItem            EQU        1024                ; Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) 
  105. kHMTrackCntlItem                EQU        2048                ; Reserved 
  106.                                                             ; Constants for hmmHelpType's when filling out HMMessageRecord 
  107. khmmString                        EQU        1                    ; help message contains a PString 
  108. khmmPict                        EQU        2                    ; help message contains a resource ID to a 'PICT' resource 
  109. khmmStringRes                    EQU        3                    ; help message contains a res ID & index to a 'STR#' resource 
  110. khmmTEHandle                    EQU        4                    ; help message contains a Text Edit handle 
  111. khmmPictHandle                    EQU        5                    ; help message contains a Picture handle 
  112. khmmTERes                        EQU        6                    ; help message contains a res ID to 'TEXT' & 'styl' resources 
  113. khmmSTRRes                        EQU        7                    ; help message contains a res ID to a 'STR ' resource 
  114. kHMEnabledItem                    EQU        0                    ; item is enabled, but not checked or control value = 0 
  115.  
  116.                                                             ; ResTypes for Styled TE Handles in Resources 
  117. kHMTETextResType                EQU        'TEXT'                ; Resource Type of text data for styled TE record w/o style info 
  118. kHMTEStyleResType                EQU        'styl'                ; Resource Type of style information for styled TE record 
  119.  
  120. kHMDisabledItem                    EQU        1                    ; item is disabled, grayed in menus or disabled in dialogs 
  121. kHMCheckedItem                    EQU        2                    ; item is enabled, and checked or control value = 1 
  122. kHMOtherItem                    EQU        3                    ; item is enabled, and control value > 1 
  123.                                                             ; Method parameters to pass to HMShowBalloon 
  124. kHMRegularWindow                EQU        0                    ; Create a regular window floating above all windows 
  125. kHMSaveBitsNoWindow                EQU        1                    ; Just save the bits and draw (for MDEF calls) 
  126. kHMSaveBitsWindow                EQU        2                    ; Regular window, save bits behind, AND generate update event 
  127.  
  128.                                                             ; Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages 
  129. kHMMenuResType                    EQU        'hmnu'                ; ResType of help resource for supporting menus 
  130. kHMDialogResType                EQU        'hdlg'                ; ResType of help resource for supporting dialogs 
  131. kHMWindListResType                EQU        'hwin'                ; ResType of help resource for supporting windows 
  132. kHMRectListResType                EQU        'hrct'                ; ResType of help resource for rectangles in windows 
  133. kHMOverrideResType                EQU        'hovr'                ; ResType of help resource for overriding system balloons 
  134. kHMFinderApplResType            EQU        'hfdr'                ; ResType of help resource for custom balloon in Finder 
  135. HMStringResType            RECORD 0
  136. hmmResID                 ds.w    1                ; offset: $0 (0)
  137. hmmIndex                 ds.w    1                ; offset: $2 (2)
  138. sizeof                     EQU *                    ; size:   $4 (4)
  139.                         ENDR
  140. HMMessageRecord            RECORD 0
  141. hmmHelpType                 ds.w    1                ; offset: $0 (0)
  142. hmmString                 ds        Str255            ; offset: $2 (2)
  143.                          ORG 2
  144. hmmPict                     ds.w    1                ; offset: $2 (2)
  145.                          ORG 2
  146. hmmTEHandle                 ds.l    1                ; offset: $2 (2)
  147.                          ORG 2
  148. hmmStringRes             ds        HMStringResType ; offset: $2 (2)
  149.                          ORG 2
  150. hmmPictRes                 ds.w    1                ; offset: $2 (2)
  151.                          ORG 2
  152. hmmPictHandle             ds.l    1                ; offset: $2 (2)
  153.                          ORG 2
  154. hmmTERes                 ds.w    1                ; offset: $2 (2)
  155.                          ORG 2
  156. hmmSTRRes                 ds.w    1                ; offset: $2 (2)
  157.                          ORG 258
  158. sizeof                     EQU *                    ; size:   $102 (258)
  159.                         ENDR
  160. ; typedef struct HMMessageRecord *        HMMessageRecPtr
  161.  
  162. ;   Public Interfaces  
  163. ;
  164. ; pascal OSErr HMGetHelpMenuHandle(MenuRef *mh)
  165. ;
  166.     IF ¨ GENERATINGCFM THEN
  167.         Macro
  168.         _HMGetHelpMenuHandle
  169.             move.w              #$0200,D0
  170.             dc.w                $A830
  171.         EndM
  172.     ELSE
  173.         IMPORT_CFM_FUNCTION HMGetHelpMenuHandle
  174.     ENDIF
  175.  
  176. ;
  177. ; pascal OSErr HMShowBalloon(const HMMessageRecord *aHelpMsg, Point tip, RectPtr alternateRect, TipFunctionUPP tipProc, SInt16 theProc, BalloonVariant balloonVariant, SInt16 method)
  178. ;
  179.     IF ¨ GENERATINGCFM THEN
  180.         Macro
  181.         _HMShowBalloon
  182.             move.w              #$0B01,D0
  183.             dc.w                $A830
  184.         EndM
  185.     ELSE
  186.         IMPORT_CFM_FUNCTION HMShowBalloon
  187.     ENDIF
  188.  
  189. ;
  190. ; pascal OSErr HMShowMenuBalloon(SInt16 itemNum, SInt16 itemMenuID, SInt32 itemFlags, SInt32 itemReserved, Point tip, RectPtr alternateRect, TipFunctionUPP tipProc, SInt16 theProc, BalloonVariant balloonVariant)
  191. ;
  192.     IF ¨ GENERATINGCFM THEN
  193.         Macro
  194.         _HMShowMenuBalloon
  195.             move.w              #$0E05,D0
  196.             dc.w                $A830
  197.         EndM
  198.     ELSE
  199.         IMPORT_CFM_FUNCTION HMShowMenuBalloon
  200.     ENDIF
  201.  
  202. ;
  203. ; pascal OSErr HMGetIndHelpMsg(ResType whichType, SInt16 whichResID, SInt16 whichMsg, SInt16 whichState, UInt32 *options, Point *tip, Rect *altRect, SInt16 *theProc, BalloonVariant *balloonVariant, HMMessageRecord *aHelpMsg, SInt16 *count)
  204. ;
  205.     IF ¨ GENERATINGCFM THEN
  206.         Macro
  207.         _HMGetIndHelpMsg
  208.             move.w              #$1306,D0
  209.             dc.w                $A830
  210.         EndM
  211.     ELSE
  212.         IMPORT_CFM_FUNCTION HMGetIndHelpMsg
  213.     ENDIF
  214.  
  215. ;
  216. ; pascal Boolean HMIsBalloon(void )
  217. ;
  218.     IF ¨ GENERATINGCFM THEN
  219.         Macro
  220.         _HMIsBalloon
  221.             move.w              #$0007,D0
  222.             dc.w                $A830
  223.         EndM
  224.     ELSE
  225.         IMPORT_CFM_FUNCTION HMIsBalloon
  226.     ENDIF
  227.  
  228. ;
  229. ; pascal Boolean HMGetBalloons(void )
  230. ;
  231.     IF ¨ GENERATINGCFM THEN
  232.         Macro
  233.         _HMGetBalloons
  234.             move.w              #$0003,D0
  235.             dc.w                $A830
  236.         EndM
  237.     ELSE
  238.         IMPORT_CFM_FUNCTION HMGetBalloons
  239.     ENDIF
  240.  
  241. ;
  242. ; pascal OSErr HMSetBalloons(Boolean flag)
  243. ;
  244.     IF ¨ GENERATINGCFM THEN
  245.         Macro
  246.         _HMSetBalloons
  247.             move.w              #$0104,D0
  248.             dc.w                $A830
  249.         EndM
  250.     ELSE
  251.         IMPORT_CFM_FUNCTION HMSetBalloons
  252.     ENDIF
  253.  
  254. ;
  255. ; pascal OSErr HMSetFont(SInt16 font)
  256. ;
  257.     IF ¨ GENERATINGCFM THEN
  258.         Macro
  259.         _HMSetFont
  260.             move.w              #$0108,D0
  261.             dc.w                $A830
  262.         EndM
  263.     ELSE
  264.         IMPORT_CFM_FUNCTION HMSetFont
  265.     ENDIF
  266.  
  267. ;
  268. ; pascal OSErr HMSetFontSize(UInt16 fontSize)
  269. ;
  270.     IF ¨ GENERATINGCFM THEN
  271.         Macro
  272.         _HMSetFontSize
  273.             move.w              #$0109,D0
  274.             dc.w                $A830
  275.         EndM
  276.     ELSE
  277.         IMPORT_CFM_FUNCTION HMSetFontSize
  278.     ENDIF
  279.  
  280. ;
  281. ; pascal OSErr HMGetFont(SInt16 *font)
  282. ;
  283.     IF ¨ GENERATINGCFM THEN
  284.         Macro
  285.         _HMGetFont
  286.             move.w              #$020A,D0
  287.             dc.w                $A830
  288.         EndM
  289.     ELSE
  290.         IMPORT_CFM_FUNCTION HMGetFont
  291.     ENDIF
  292.  
  293. ;
  294. ; pascal OSErr HMGetFontSize(UInt16 *fontSize)
  295. ;
  296.     IF ¨ GENERATINGCFM THEN
  297.         Macro
  298.         _HMGetFontSize
  299.             move.w              #$020B,D0
  300.             dc.w                $A830
  301.         EndM
  302.     ELSE
  303.         IMPORT_CFM_FUNCTION HMGetFontSize
  304.     ENDIF
  305.  
  306. ;
  307. ; pascal OSErr HMSetDialogResID(SInt16 resID)
  308. ;
  309.     IF ¨ GENERATINGCFM THEN
  310.         Macro
  311.         _HMSetDialogResID
  312.             move.w              #$010C,D0
  313.             dc.w                $A830
  314.         EndM
  315.     ELSE
  316.         IMPORT_CFM_FUNCTION HMSetDialogResID
  317.     ENDIF
  318.  
  319. ;
  320. ; pascal OSErr HMSetMenuResID(SInt16 menuID, SInt16 resID)
  321. ;
  322.     IF ¨ GENERATINGCFM THEN
  323.         Macro
  324.         _HMSetMenuResID
  325.             move.w              #$020D,D0
  326.             dc.w                $A830
  327.         EndM
  328.     ELSE
  329.         IMPORT_CFM_FUNCTION HMSetMenuResID
  330.     ENDIF
  331.  
  332. ;
  333. ; pascal OSErr HMBalloonRect(const HMMessageRecord *aHelpMsg, Rect *coolRect)
  334. ;
  335.     IF ¨ GENERATINGCFM THEN
  336.         Macro
  337.         _HMBalloonRect
  338.             move.w              #$040E,D0
  339.             dc.w                $A830
  340.         EndM
  341.     ELSE
  342.         IMPORT_CFM_FUNCTION HMBalloonRect
  343.     ENDIF
  344.  
  345. ;
  346. ; pascal OSErr HMBalloonPict(const HMMessageRecord *aHelpMsg, PicHandle *coolPict)
  347. ;
  348.     IF ¨ GENERATINGCFM THEN
  349.         Macro
  350.         _HMBalloonPict
  351.             move.w              #$040F,D0
  352.             dc.w                $A830
  353.         EndM
  354.     ELSE
  355.         IMPORT_CFM_FUNCTION HMBalloonPict
  356.     ENDIF
  357.  
  358. ;
  359. ; pascal OSErr HMScanTemplateItems(SInt16 whichID, SInt16 whichResFile, ResType whichType)
  360. ;
  361.     IF ¨ GENERATINGCFM THEN
  362.         Macro
  363.         _HMScanTemplateItems
  364.             move.w              #$0410,D0
  365.             dc.w                $A830
  366.         EndM
  367.     ELSE
  368.         IMPORT_CFM_FUNCTION HMScanTemplateItems
  369.     ENDIF
  370.  
  371. ;
  372. ; pascal OSErr HMExtractHelpMsg(ResType whichType, SInt16 whichResID, SInt16 whichMsg, SInt16 whichState, HMMessageRecord *aHelpMsg)
  373. ;
  374.     IF ¨ GENERATINGCFM THEN
  375.         Macro
  376.         _HMExtractHelpMsg
  377.             move.w              #$0711,D0
  378.             dc.w                $A830
  379.         EndM
  380.     ELSE
  381.         IMPORT_CFM_FUNCTION HMExtractHelpMsg
  382.     ENDIF
  383.  
  384. ;
  385. ; pascal OSErr HMGetDialogResID(SInt16 *resID)
  386. ;
  387.     IF ¨ GENERATINGCFM THEN
  388.         Macro
  389.         _HMGetDialogResID
  390.             move.w              #$0213,D0
  391.             dc.w                $A830
  392.         EndM
  393.     ELSE
  394.         IMPORT_CFM_FUNCTION HMGetDialogResID
  395.     ENDIF
  396.  
  397. ;
  398. ; pascal OSErr HMGetMenuResID(SInt16 menuID, SInt16 *resID)
  399. ;
  400.     IF ¨ GENERATINGCFM THEN
  401.         Macro
  402.         _HMGetMenuResID
  403.             move.w              #$0314,D0
  404.             dc.w                $A830
  405.         EndM
  406.     ELSE
  407.         IMPORT_CFM_FUNCTION HMGetMenuResID
  408.     ENDIF
  409.  
  410. ;
  411. ; pascal OSErr HMGetBalloonWindow(WindowRef *window)
  412. ;
  413.     IF ¨ GENERATINGCFM THEN
  414.         Macro
  415.         _HMGetBalloonWindow
  416.             move.w              #$0215,D0
  417.             dc.w                $A830
  418.         EndM
  419.     ELSE
  420.         IMPORT_CFM_FUNCTION HMGetBalloonWindow
  421.     ENDIF
  422.  
  423.     ENDIF
  424.     ENDIF ; __BALLOONS__ 
  425.  
  426.